// email
function sendMailCancel(id){
	var size = { width: 'auto', height: 'auto'};
	var buttons = [
	    		   { title:"Send Mail" , callback: function(thisdialog,args){
	    			   
	    		   }},
	    		   { title:"Cancel" , callback: function(thisdialog,args){
	    			   thisdialog.dialog("close");
	    		   }}
	    		];
	var content = "<table>" +
			"<tr>" +
			"<td>" +
			"Email:" +
			"</td>" +
			"<td>" +
			"<input type='text'>" +
			"</td>" +
			"</tr>" +
			"<tr>" +
			"<td>" +
			"&nbsp" +
			"</td>" +
			"</tr>" +
			"<tr>" +
			"<td>" +
			"&nbsp" +
			"</td>" +
			"</tr>" +
			"</table>"
	customDialog("Send E-mail",content,size,buttons,null);
	var top_value = $("#"+id).offset().top-5;
	var left_value = $("#"+id).offset().left-200;
	$("[class*=ui-dialog]:visible").offset({ top: top_value, left: left_value });
}
function sendMail(id){
	var size = { width: 'auto', height: 'auto'};
	var buttons = [
	    		   { title:"Preview Mail" , callback: function(thisdialog,args){
	    			   
	    		   }},
	    		   { title:"Send Mail" , callback: function(thisdialog,args){
	    			   
	    		   }},
	    		   { title:"Cancel" , callback: function(thisdialog,args){
	    			   thisdialog.dialog("close");
	    		   }}
	    		];
	var content = "<table>" +
			"<tr>" +
			"<td>" +
			"Name:" +
			"</td>" +
			"<td>" +
			"<input type='text'>" +
			"</td>" +
			"</tr>" +
			"<tr>" +
			"<td>" +
			"Email:" +
			"</td>" +
			"<td>" +
			"<input type='text'>" +
			"</td>" +
			"</tr>" +
			"<tr>" +
			"<td>" +
			"&nbsp" +
			"</td>" +
			"<td>" +
			"Hide Price <input type='checkbox'>" +
			"</td>" +
			"</tr>" +
			"<tr>" +
			"<td>" +
			"&nbsp" +
			"</td>" +
			"<td valign='top' >" +
			"<span class='link' id='s"+id+"' onclick='changeType(id)' >Add Message</span>" +
			"<span  style='display:none' id='t"+id+"' onclick='changeType(id)' >Message: <textarea></textarea><span class='colse_iconTextarea' id='t"+id+"' onclick='changeType(id)' ></sapn></span>"+
			"</td>" +
			"</tr>" +
			"</table>"
	customDialog("Send E-mail",content,size,buttons,null);
	var top_value = $("#"+id).offset().top-5;
	var left_value = $("#"+id).offset().left-300;
	$("[class*=ui-dialog]:visible").offset({ top: top_value, left: left_value });
}
function changeType(id){
	var subid = id.substr(1,id.length);
	var checkType = id.substr(0,1);
	if(checkType=="s"){
		$("[id="+id+"]:visible").css("display","none");
		$("[id=t"+subid+"]:hidden").css("display","");
	}else{
		$("[id="+id+"]:visible").css("display","none");
		$("[id=s"+subid+"]:hidden").css("display","");
	}
}
//